import redis
import time
import json

REDIS_CONFIG = {
    'host': 'localhost',  # IP
    'port': 6379,  # 端口
    'password': '',  # 密码
    'db': 0,  # 数据库
    'decode_responses': True # 将存入的数据进行解码（主要用于将bytes类型转成string类型）
}
r = redis.StrictRedis(**REDIS_CONFIG)
print(r.get("fog1"))
# print(json.dumps(r.get("fog1")).split(","))
# print(type(json.dumps(r.get("fog2"))))
# i = 0
# y = 0
# while 1:  
#     time.sleep(0.1)
#     if i == 120:
#         i=0
#         y*=10
#     r.set(i, value=y)
#     y+=1
#     i+=1
# for i in range(120):
#     # r.delete(i)
#     print(r.get(i))